<?php
/**
 * Optionable.php		
 *
 * @package		
 * @Copyright	(c) All rights reserved
 * @Author		skyCrack <skyCrack@126.com>
 * @Version		$Id$
 */

abstract class Optionable {
	protected $_options		=	array();
	
	public function __construct(array $options = array()) {
		$this->setOptions($options);
	}
	
	public function setOptions(array $options = array()) {
		foreach ( $options as $name => $value ) {
			$this->_setOption($name, $value);
		}
	}
	
	protected function _setOption($name, $value) {
		if ( array_key_exists($name, $this->_options) ) {
			$this->_options[$name]		=	$value;
		}
	}
}
?>